package com.mc.music_web.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    private Integer userId;

    @NotEmpty(message="{user.usersNames.required}")
    @Pattern(regexp="^.*(?=.{6,}).*$",message="{user.usersNames.invalid}")
    private  String usersName;
    @NotNull
    @Pattern(regexp ="^.*(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$",message = "{user.password.invalid}")
    private  String password;

    private  String protrait;
    @NotNull
    @Pattern(regexp ="^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$",message ="{user.phone.invalid}")
    private  String phone;
    @NotNull
    @Email
    @Pattern(regexp ="^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$",message ="{user.usersEmail.invalid}")
    private  String usersEmail;

    private  String likeType;
    private MultipartFile myfile;
}
